<script type="text/javascript" src="js/bug.public.js"></script>
<script type="text/javascript" src="js/bug.add.js"></script>
<script type="text/javascript" src="js/selectuser.js"></script>
<script type="text/javascript">
// 用户设置的默认模板
var G_default_tplid = <?php echo $this->defaultTplId?>;
</script>
<?php echo includeFile('/Common/Bug-menu.html')?>
<style type="text/css">
.sw{
width:100px;
}
.bp{
margin-left:100px;
}
</style>
<div id="addBugDiv">
<form enctype="multipart/form-data" method="post" action="">
<table width="100%">
  <tbody><tr>
    <td><?php echo L('select_tpl')?>:</td>
    <td>
	<select id="bugTpl">
		<option value="0"><?php echo L('default_tpl')?></option>
		<?php foreach($this->bugtplList as $row):?>  
		<option value="<?php echo $row['id']?>"><?php echo $row['tplname']?></option>
		<?php endforeach;?>
		<option value="-1" style="color:red;"><?php echo L('add_define_tpl')?></option>
	</select>
	<a href="" id="saveDefaultBtn">[<?php echo L('save_default_tpl')?>]</a>
    </td>
  </tr>
  <tr>
    <td><?php echo L('project')?>:</td>
    <td>
	<select id="projectid" name="projectid">
		<option value="0"><?php echo L('select_project')?></option>
		<?php foreach($this->projectList as $row):?>  
		<option value="<?php echo $row['projectid']?>"><?php echo $row['projectname']?></option>
		<?php endforeach;?>
	</select>
	<select id="verid" name="verid">
	<option value="0"><?php echo L('select_ver')?></option>
	</select>
	<select id="moduleid" name="moduleid">
	<option value="0"><?php echo L('select_module')?></option>
	</select></td>
  </tr>
  <tr>
    <td><?php echo L('subject')?>:</td>
    <td><input type="text" id="subject" name="subject" size="80"></td>
  </tr>
  <tr>
    <td><?php echo L('bug_info')?>:</td>
    <td><?php echo getFckeditor($this->tplhtml,'fckEditInfo','600px','400px')?></td>
  </tr>
  <tr>
    <td><?php echo L('to_user')?>:</td>
    <td>
    <select id="usergroup" name="usergroup" class="sw">
      <option value="0"><?php echo L('select_group')?></option>
		<?php foreach($this->groupList as $row):?>  
		<option value="<?php echo $row['groupid']?>"><?php echo $row['groupname']?></option>
		<?php endforeach;?>
    </select>
    <select id="userid" name="userid" class="sw">
	<option value="0"><?php echo L('select_user')?></option>
	</select>
    </td>
  </tr>
  <tr>
    <td><?php echo L('note_type')?>:</td>
    <td>
    <input name="notifyMsg" type="checkbox" value="1" checked="checked" />
    <?php echo L('system_note')?><span class="notuser"></span>
    <input name="notifyRtx" type="checkbox" value="1" checked="checked" />
    <?php echo L('rtx_note')?><span class="notuser"></span>
    <input name="notifyEmail" type="checkbox" value="1" checked="checked" />
    <?php echo L('email_note')?><span class="notuser"></span>
    </td>
  </tr>
  <tr>
    <td><?php echo L('bug_attrib')?>:</td>
    <td><select id="severity" name="severity" class="sw">
      <?php echo getBugItem('severity',true,3)?>
    </select><?php echo L('severity')?>
    <span class="bp">
    <select id="frequency" name="frequency" class="sw">
	<?php echo getBugItem('frequency',true,1)?>
    </select><?php echo L('frequency')?>
     </span>
	</td>
  </tr>
  <tr>
    <td></td>
    <td><select id="bugtype" name="bugtype" class="sw">
	<?php echo getBugItem('bugtype',true,1)?>
    </select><?php echo L('bugtype')?>
    <span class="bp">
    <select id="priority" name="priority" class="sw">
	<?php echo getBugItem('priority',true,3)?>
    </select><?php echo L('priority')?>
    </span>
    </td>
  </tr>
  <tr>
    <td><?php echo L('attachment')?>:</td>
    <td>
    <a id="addDocLink" href="">[<?php echo L('add_atta')?>]</a>（<?php echo L('add_atta_tips')?>） 
   <div id="uploadFiles"></div>
    
    </td>
  </tr>

  <tr>
  	<td></td>
	<td style="border: 1px solid #C5D7EF; height:40px;line-height:40px;background-color:#FCFCFC">
	<input id="inviteBox" name="inviteBox" type="checkbox" value="1" /><?php echo L('invite')?>
	<span id="inviteSpan" style="display:none;">
	<input type="text" id="ivtuser" name="ivtuser" size="40" value="username1,username2"/><a href="" id="selInviteUset"><?php echo L('select_user')?></a>
	</span>
	</td>
  </tr>

  <tr>
  <td>&nbsp;</td>
    <td>
    <button type="button" savetype="1"><?php echo L('submit_view')?></button>
    <button type="button" savetype="2"><?php echo L('submit_return')?></button>
    <!-- <button type="button" savetype="0">存为草稿</button> -->
      </td>
    </tr>
</tbody></table>
<!-- 提交类型 0:存为草稿 1:发布查看 2:发布返回  -->
<input type="hidden" value="1" name="savetype" id="savetype" />
<!-- 上一个地址 -->
<input type="hidden" value="<?php echo urlencode($this->request->frontUrl())?>" name="fronturl" />
</form>
</div>

<?php echo includeFile('/Common/Bug-public-tpl.html')?>